package com.msc.config;

/**
 * @author masc
 * @date 2022-08-07 17:24
 * <p></p>
 */
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.List;

@Data
@ConfigurationProperties(prefix = "app.swagger")
public class SwaggerProperties {

    private boolean enable;

    private ApiInfo apiInfo = new ApiInfo();

    private Contact contact = new Contact();

    private List<CustomSwaggerResource> resources;

    private boolean enableAuthorize;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    protected static class ApiInfo {
        private String version = "1.0.0-SNAPSHOT";
        private String title = "RESTful API";
        private String description = "API 描述";
        private String termsOfServiceUrl;
        private String license;
        private String licenseUrl;
        private Contact contact;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    protected static class Contact {
        private String name = "丝袜哥";
        private String url = "http://www.url.com";
        private String email = "59968873@qq.com";
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class CustomSwaggerResource {
        private String name;

        private String url;

        private String version;
    }
}
